package com.yunsc.product.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.yunsc.product.entity.YunscGoodsImageEntity;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

/**
 * 商品图片记录表
 * 
 * @author adan
 * @email 2028038953@qq.com
 * @date 2024-04-04 21:28:42
 */
@Mapper
public interface YunscGoodsImageDao extends BaseMapper<YunscGoodsImageEntity> {

    /**
     * 根据商品ID查询图片ID列表
     * @param goodsId 商品ID
     * @return 图片ID列表
     */
    @Select("SELECT image_id FROM yunsc_goods_image WHERE goods_id = #{goodsId} order by create_time")
    List<Integer> queryImageIdsByGoodsId(Integer goodsId);
}
